Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

123
Vistas
"Contains" and "Not Contains" methods in SQL or by using Java script UDF

Can we use "Contains" and "NotContains" methods in SQL i.e., How do I check if a string or a column value is contained in another column of a table.

Problem Statement:

  1. How do I check if a string "ABC" is contained/Not contained in "Column1"
  2. How do I check if a "Column1" value is contained/Not contained in "Column2"

If not SQL can we use JavaScript UDF or any other means to make this happen?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

CONTAINS:

Returns true if expr1 contains expr2. Both expressions must be text or binary expressions.

CONTAINS( <expr1> , <expr2> )

Examples:

SELECT * FROM tab WHERE (Colum1, 'ABC');
SELECT * FROM tab WHERE NOT (Colum1, 'ABC');

SELECT * FROM tab WHERE (Colum1, Column2);
SELECT * FROM tab WHERE NOT (Colum1, Column2);

It is worth mentioning Snowflake LIKE/ILIKE [ANY]:

SELECT *
FROM tab
WHERE Column1 LIKE ANY ('%ABC%','%XYZ%');
about 4 years ago · Juan Pablo Isaza Denunciar

0

You can use Like operator I believe i am not sure what exactly are you looking for but here is an example below. For more details: https://www.w3schools.com/sql/sql_like.asp

select column
from [table]
where column Like %ABC%

or if you already know the values that you are looking for in a specific column then you can use in operator:

select column from [table] where column in ('ABC','XYZ')

This will give you the rows for the column, where the values are equal to either ABC or XYZ

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda